package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.RechargeMapper;
import com.qfedu.openplateform.manager.entity.Recharge;
import com.qfedu.openplateform.manager.service.RechargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RechargeServiceImpl implements RechargeService {

    @Autowired
    private RechargeMapper rechargeMapper;

    @Override
    public List<Recharge> findAllRecharge(Integer page, Integer limit) {
        return rechargeMapper.findAllRecharge();
    }

    @Override
    public int insertRecharge(Recharge recharge) {
        return rechargeMapper.insertRecharge(recharge);
    }

    @Override
    public int updateRecharge(Recharge recharge) {
        return rechargeMapper.updateRecharge(recharge);
    }

    @Override
    public void deleteRecharge(Integer[] ids) {
        for (Integer id : ids) {
            rechargeMapper.deleteRecharge(id);
        }
    }

}
